<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>11 vue的数据类型操作</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>{{str}}</h3>
        <h3><input :id = "str" :value = "str" :style = "css" @input = "change"></h3>
        <button @click="fanzhuang">反转</button>
    </div>
    
</body>

<script>
    new Vue({
        el:"#app",
        data:{
            num : 100,
            str : "我是字符串",
            css : "color:red"
        },
        methods:{
            change(){
                this.str = window.event.target.value;
            },
            fanzhuang(){
                this.str = this.str.split("").reverse().join("")
            }
        }
    })


</script>
</html>